
print('Vvedite skobochnu posledovatelnost:')
a = input()
rt = True
o = ''
for n in a:
    if n in'({[<':
        o +=n
    if n in ')>]}':
        if len (o) ==0:
            rt= False
            break
        if o[-1] == '(' and n==')' or o[-1] == '[' and n==']' or o[-1] == '<' and x=='>' or o[-1] == '{' and n=='}' :
            rt=rt[0:-1]
        else:
            rt = False
            break
print (rt)

